<template>
  <div class="container">
    <el-dialog
      title="财务结算操作详情"
      :visible.sync="dialog.centerDialogVisible"
      @open="getData"
      @close="confirm"
      center
      :width="widths?'50%':'100%'"
    >
      <el-table :data="tableData" border style="width: 100%" empty-text="暂无数据">
      
        <el-table-column prop="nickname" label="操作人" align="center"></el-table-column>
        <el-table-column prop="opt_desc" label="操作描述" align="center"></el-table-column>
        <el-table-column prop="remark" label="操作备注" align="center"></el-table-column>
        <el-table-column prop="opt_time" label="操作时间" align="center"></el-table-column>
      </el-table>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="confirm">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { findOptInfo } from "@/api/superSettlement/settlementList";
export default {
  props: {
    dialog: Object
  },
  data() {
    return {
      tableData: [],
      center: [],
      widths: true
    };
  },
  created() {
    this.phones();
  },
  methods: {
    //判断是否移动端
    phones() {
      let widthScreen = window.screen.width;
      if (widthScreen > 768) {
        this.widths = true;
      } else {
        this.widths = false;
      }
    },
    //关闭
    confirm() {
      this.dialog.centerDialogVisible = false;
    },
    // 获取数据
    getData() {
      this.tableData = [];
      let data = {
        id: this.dialog.id
      };
      findOptInfo(data).then(res => {
        if (res.code == 0) {
          this.tableData = res.data.list;
        }
      });
    }
  }
};
</script>
<style scoped>
.pagination {
  text-align: right;
  padding: 10px;
}
</style>